package cn.golxen.exception;

import cn.golxen.commons.entity.Result;
import cn.golxen.commons.exception.GatewayException;
import cn.golxen.commons.exception.GoodsAddException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
class ExceptionController {

    @ExceptionHandler(value = {GatewayException.class})
    public Result goodsAddException(GatewayException e){
        return new Result(e.getCode(),e.getMessage());
    }



}